<?php

  class AllDifferentCategory extends Category
  {
    public function __construct($name, Dice $dice)
    {
      parent::__construct($name, $dice);
      
      $filteredDice = array_filter($dice->getValueCount(), array($this, "check"));
      
      if (count($filteredDice) == 5) {
        $this->score = 40;
      } else {
        $this->score = 0;
      }
    }
    
    private function check($num)
    {
      if ($num == 1) {
        return true;
      } else {
        return false;
      }
    }
  }
  
?>